import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      redirect: '/home',
      component: () => import('../views/layout/layoutIndex.vue'),
      children: [
        {
          path: '/home',
          meta: {
            title: '首页'
          },
          component: () => import('../views/home/homeIndex.vue')
        },
        {
          path: '/message',
          meta: {
            title: '消息'
          },
          component: () => import('../views/message/msgIndex.vue')
        },
        {
          path: '/shop',
          meta: {
            title: '商城'
          },
          component: () => import('../views/shop/shopIndex.vue')
        },
        {
          path: '/case',
          meta: {
            title: '患者案例'
          },
          component: () => import('../views/case/caseIndex.vue')
        },
        {
          path: '/mine',
          meta: {
            title: '我的'
          },
          component: () => import('../views/mine/mineIndex.vue')
        }
      ]
    },
    // 设置
    {
      path:'/emit',
      name:'emit',
      component:()=>import('../views/emit/emitInde.vue')
    },
    // 登录
    {
      path:'/login',
      name:'login',
      component:()=>import('../views/login/loginIndex.vue')
    },
    // 注册
    {
      path:'/register',
      name:'register',
      component:()=>import('../views/register/register.vue')
    },
    //引导页
    {
      path:'/lead',
      name:'lead',
      component:()=>import('../views/lead/lead.vue')
    },
    // 修改昵称
    {
      path:'/emit-emit',
      name:'emit-emit',
      component:()=>import('../views/emit-emit/emittIndex.vue')
    },
    // 在线问诊
    {
      path:'/zxwz',
      name:'zxwz',
      component:()=>import('../views/box/zxwz/zxwzIndex.vue')
    },
    // 健康档案
    {
      path:'/jkda',
      name:'jkda',
      component:()=>import('../views/box/jkda/jkdaIndex.vue')
    },
    // 用药建议
    {
      path:'/yyjy',
      name:'yyjy',
      component:()=>import('../views/box/yyjy/yyjyIndex.vue')
    },
    // 优选订单
    {
      path:'/yxdd',
      name:'yxdd',
      component:()=>import('../views/box/yxdd/yxddIndex.vue')
    },
    // 我的医生
    {
      path:'/wdys',
      name:'wdys',
      component:()=>import('../views/box/wdys/wdysIndex.vue')
    },
    // 随访计划
    {
      path:'/sfjh',
      name:'sfjh',
      component:()=>import('../views/box/sfjh/sfjhIndex.vue')
    },
  ],
})

export default router
